<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">

<h:head>
	<title>祖龙娱乐  - BI系统</title>
	<link href="../../css/component.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="../../js/highcharts.js"></script>
	<script type="text/javascript" src="../../js/drawChart.js"></script>
</h:head>

<h:body>
	<ui:param name="bean" value="#{overviewPayAction}" />
	
	<span class="pagetitle">付费分析 —— 付费收入</span>
	<p:separator />
	
	<!-- 右侧页面顶部查询部分 -->
	<h:form id="fsearch">
		<p:growl id="growl" showDetail="true" sticky="true" />
        <p:calendar value="#{bean.dateStart}" mode="popup" pattern="yyyy-MM-dd" />
		-
		<p:calendar value="#{bean.dateEnd}" mode="popup" pattern="yyyy-MM-dd" />
		&#160;&#160;&#160;
		
		<p:selectOneMenu id="platformSel" styleClass="queryPlatform" value="#{bean.queryPlatform}">
	        <f:selectItems value="#{bean.platformItmes}" />
	        <p:ajax update="channelSel serverSel" listener="#{bean.updateChannelItmes}" />
        </p:selectOneMenu>
        &#160;&#160;&#160;
        
        <p:selectOneMenu id="channelSel" styleClass="queryChannel" value="#{bean.queryChannel}">
	        <f:selectItems value="#{bean.channelItmes}" />
	        <p:ajax update="serverSel platformSel" listener="#{bean.updateServerItmes}" />
        </p:selectOneMenu>
        &#160;&#160;&#160;
        
        <p:selectOneMenu id="serverSel" styleClass="queryServer" value="#{bean.queryServer}">
	         <f:selectItems value="#{bean.serverItmes}" />
	         <p:ajax update="channelSel platformSel" listener="#{bean.selectedServer}" />
        </p:selectOneMenu>
        &#160;&#160;&#160;
		
        <p:commandButton value="查询" action="#{bean.search()}" update=":data" ajax="false" />
	</h:form>
	<br />

	<!-- 数据展示部分，包含表格和图表 -->
	<h:form id="dform">
		<h:panelGrid columns="1" style="width:100%">
             <div id="basewidth" style="width:94%;height:0; border:0;" />
        </h:panelGrid>
        <h:panelGrid columns="1" style="width:100%">
             <div id="basewidth2" style="width:91%;height:0; border:0;" />
        </h:panelGrid>
	
		<div class="data" id="data">
			<p:panel id="panel1" header="付费总体数据" style="margin-bottom:10px;">
	        	<h:commandLink>
		        	<p:graphicImage url="/resources/images/excel.png" height="25px"/>
		       		<p:dataExporter type="xls" target="dlist1" fileName="allUserPayData-#{pageHelper.getNewDateDetailStr()}"/>
			    </h:commandLink>
				<p:dataTable id="dlist1" var="l" value="#{bean.overviewPayData}" scrollable="true" resizableColumns="true" paginator="false" style="text-align:center;">
					<p:column headerText="活跃人数" styleClass="column grcnewUser">
						<h:outputLabel value="#{l.activeUser}" />
					</p:column>
					<p:column headerText="付费金额#{pageHelper.getMoneyType()}" styleClass="column grcnewUser">
						<h:outputLabel value="#{l.payCount}" />
					</p:column>
					<p:column headerText="付费人数" styleClass="column grcnewUser">
						<h:outputLabel value="#{l.payUser}" />
					</p:column>
					<p:column headerText="付费渗透率" styleClass="column grcnewUser">
						<h:outputLabel value="#{pageHelper.double2Percent(l.payInRadio)}" />
					</p:column>
					<p:column headerText="付费ARPU#{pageHelper.getMoneyType()}" styleClass="column grcnewUser">
						<h:outputLabel value="#{l.payARPU}" />
					</p:column>
					<p:column headerText="活跃ARPU#{pageHelper.getMoneyType()}" styleClass="column grcnewUser">
						<h:outputLabel value="#{l.activeARPU}" />
					</p:column>
				</p:dataTable>
			</p:panel>
			
			<br />
			<p:separator />
			<p:accordionPanel>
				<p:ajax event="tabChange" listener="#{bean.onTabChange}" update="chart12" />
			
		        <p:tab title="付费趋势">
		            <p:dataGrid id="chart11" var="c" value="#{bean.payTrendChart}" columns="1" layout="grid">
		            	<p:selectOneMenu id="channel" value="#{c.selectItem}">
				            <f:selectItems value="#{c.allItmes}" />
				            <p:ajax update="chart11" listener="#{bean.handleDateChange}" />
			          	</p:selectOneMenu>
				        <p:panel style="text-align:center">
				            <h:panelGrid columns="1" style="width:100%">
				                <div id="highchartChart1" style="width:100%;height:400px; border:0;">
									<script type="text/javascript">
										generateChart('#{c.jsonStr}', '#{c.jsonType}', '1', 'basewidth');
									</script>  
								</div>
				            </h:panelGrid>
				        </p:panel>
				    </p:dataGrid>
				    
				    <br />
				    <p:dataTable id="dlist11" var="l" value="#{bean.payTrendData}" scrollable="true" resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {Exporters}" rowsPerPageTemplate="15,30" rows="30" style="text-align:center;">
						<f:facet name="{Exporters}">
				        	<h:commandLink styleClass="exporter">
						        <p:graphicImage url="/resources/images/excel.png" height="25px"/>
						        <p:dataExporter type="xls" target="dlist11" fileName="payTrendData-#{pageHelper.getNewDateDetailStr()}"/>
						    </h:commandLink>
					    </f:facet>
						
						<p:column headerText="日期" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.dateStr}" />
						</p:column>
						<p:column headerText="付费金额#{pageHelper.getMoneyType()}" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.payCount}" />
						</p:column>
						<p:column headerText="付费人数" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.payUser}" />
						</p:column>
						<p:column headerText="付费渗透率" styleClass="column grcnewUser">
							<h:outputLabel value="#{pageHelper.double2Percent(l.payInRadio)}" />
						</p:column>
						<p:column headerText="付费ARPU#{pageHelper.getMoneyType()}" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.payARPU}" />
						</p:column>
						<p:column headerText="活跃ARPU#{pageHelper.getMoneyType()}" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.activeARPU}" />
						</p:column>
					</p:dataTable>
		        </p:tab>
		        
		        <p:tab title="付费分类">
		        	<p:dataGrid var="c" value="#{bean.payClassChart}" columns="3" layout="grid">
				        <p:panel style="text-align:center">
				            <h:panelGrid columns="1" style="width:100%">
				                <div id="highchartChart#{c.jsId}" style="width:28%;height:300px; border:0;">
									<script type="text/javascript">
										generateChart('#{c.jsonStr}', '#{c.jsonType}', '#{c.jsId}');
									</script>  
								</div>
				            </h:panelGrid>
				        </p:panel>
				    </p:dataGrid>
				    
				    <br />
				    <p:dataTable id="dlist99" var="l" value="#{bean.payClassData}" scrollable="true" resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {Exporters}" rowsPerPageTemplate="15,30" rows="30" style="text-align:center;">
						<f:facet name="{Exporters}">
				        	<h:commandLink styleClass="exporter">
						        <p:graphicImage url="/resources/images/excel.png" height="25px"/>
						        <p:dataExporter type="xls" target="dlist99" fileName="payClassData-#{pageHelper.getNewDateDetailStr()}"/>
						    </h:commandLink>
					    </f:facet>
						
						<p:column headerText="分类" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.classStr}" />
						</p:column>
						<p:column headerText="活跃人数" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.activeUser}" />
						</p:column>
						<p:column headerText="付费人数" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.payUser}" />
						</p:column>
						<p:column headerText="付费金额#{pageHelper.getMoneyType()}" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.payCount}" />
						</p:column>
						
						<p:column headerText="付费渗透率" styleClass="column grcnewUser">
							<h:outputLabel value="#{pageHelper.double2Percent(l.payInRadio)}" />
						</p:column>
						<p:column headerText="付费ARPU#{pageHelper.getMoneyType()}" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.payARPU}" />
						</p:column>
						<p:column headerText="活跃ARPU#{pageHelper.getMoneyType()}" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.activeARPU}" />
						</p:column>
					</p:dataTable>
		        </p:tab>
		        
		        <p:tab title="付费区间" rendered="false">
		           <p:dataGrid id="chart12" var="c" value="#{bean.payRangeChart}" columns="1" layout="grid">
				        <p:panel style="text-align:center">
				            <h:panelGrid columns="1" style="width:100%">
				                <div id="highchartChart2" style="width:100%;height:400px; border:0;">
									<script type="text/javascript">
										generateChart('#{c.jsonStr}', '#{c.jsonType}', '2', 'basewidth');
									</script>  
								</div>
				            </h:panelGrid>
				        </p:panel>
				    </p:dataGrid>
				    
				    <br />
				    <p:dataTable id="dlist12" var="l" value="#{bean.payRangeData}" scrollable="true" resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {Exporters}" rowsPerPageTemplate="15,30" rows="30" style="text-align:center;">
						<f:facet name="{Exporters}">
				        	<h:commandLink styleClass="exporter">
						        <p:graphicImage url="/resources/images/excel.png" height="25px"/>
						        <p:dataExporter type="xls" target="dlist12" fileName="payRangeData-#{pageHelper.getNewDateDetailStr()}"/>
						    </h:commandLink>
					    </f:facet>
						
						<p:column headerText="付费区间" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.rangeStr}" />
						</p:column>
						<p:column headerText="付费人数" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.payUser}" />
						</p:column>
						<p:column headerText="付费人数比例" styleClass="column grcnewUser">
							<h:outputLabel value="#{pageHelper.double2Percent(l.payUserRadio)}" />
						</p:column>
						<p:column headerText="付费金额#{pageHelper.getMoneyType()}" styleClass="column grcnewUser">
							<h:outputLabel value="#{l.payCount}" />
						</p:column>
						<p:column headerText="付费金额比例" styleClass="column grcnewUser">
							<h:outputLabel value="#{pageHelper.double2Percent(l.payCountRadio)}" />
						</p:column>
					</p:dataTable>
		        </p:tab>
		        
		        <p:tab title="付费对比">
		        	<p:tabView>
			    		<p:ajax event="tabChange" listener="#{bean.onCompareTabChange}" update="chart131 dlist131 chart132 dlist132 chart133 dlist133"/>
			    		
				        <p:tab title="平台对比" id="platform1">
				        	<p:dataGrid id="chart131" var="c" value="#{bean.payCompareChart}" columns="1" layout="grid">
						        <p:panel style="text-align:center">
						            <h:panelGrid columns="1" style="width:100%">
						                <div id="highchartChart3" style="width:1440px;height:400px; border:0;">
											<script type="text/javascript">
												generateChart('#{c.jsonStr}', '#{c.jsonType}', '3', 'basewidth2');
											</script>  
										</div>
						            </h:panelGrid>
						        </p:panel>
						    </p:dataGrid>
						    
						    <br />
						    <p:dataTable id="dlist131" var="l" value="#{bean.payCompareData}" scrollable="true" resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {Exporters}" rowsPerPageTemplate="15,30" rows="30" style="text-align:center;">
								<f:facet name="{Exporters}">
						        	<h:commandLink styleClass="exporter">
								        <p:graphicImage url="/resources/images/excel.png" height="25px"/>
								        <p:dataExporter type="xls" target="dlist131" fileName="platformPayCompareData-#{pageHelper.getNewDateDetailStr()}"/>
								    </h:commandLink>
							    </f:facet>
								
								<p:column headerText="分类" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.classStr}" />
								</p:column>
								<p:column headerText="付费人数" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.payUser}" />
								</p:column>
								<p:column headerText="付费人数比例" styleClass="column grcnewUser">
									<h:outputLabel value="#{pageHelper.double2Percent(l.payUserRadio)}" />
								</p:column>
								<p:column headerText="付费金额#{pageHelper.getMoneyType()}" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.payCount}" />
								</p:column>
								<p:column headerText="付费金额比例" styleClass="column grcnewUser">
									<h:outputLabel value="#{pageHelper.double2Percent(l.payCountRadio)}" />
								</p:column>
							</p:dataTable>
				        </p:tab>
				        
				        <p:tab title="渠道对比" id="channel1">
				        	<p:dataGrid id="chart132" var="c" value="#{bean.payCompareChart}" columns="1" layout="grid">
						        <p:panel style="text-align:center">
						            <h:panelGrid columns="1" style="width:100%">
						                <div id="highchartChart4" style="width:100%;height:400px; border:0;">
											<script type="text/javascript">
												generateChart('#{c.jsonStr}', '#{c.jsonType}', '4', 'basewidth2');
											</script>  
										</div>
						            </h:panelGrid>
						        </p:panel>
						    </p:dataGrid>
						    
						    <br />
						    <p:dataTable id="dlist132" var="l" value="#{bean.payCompareData}" scrollable="true" resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {Exporters}" rowsPerPageTemplate="15,30" rows="30" style="text-align:center;">
								<f:facet name="{Exporters}">
						        	<h:commandLink styleClass="exporter">
								        <p:graphicImage url="/resources/images/excel.png" height="25px"/>
								        <p:dataExporter type="xls" target="dlist132" fileName="channelPayCompareData-#{pageHelper.getNewDateDetailStr()}"/>
								    </h:commandLink>
							    </f:facet>
								
								<p:column headerText="分类" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.classStr}" />
								</p:column>
								<p:column headerText="付费人数" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.payUser}" />
								</p:column>
								<p:column headerText="付费人数比例" styleClass="column grcnewUser">
									<h:outputLabel value="#{pageHelper.double2Percent(l.payUserRadio)}" />
								</p:column>
								<p:column headerText="付费金额#{pageHelper.getMoneyType()}" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.payCount}" />
								</p:column>
								<p:column headerText="付费金额比例" styleClass="column grcnewUser">
									<h:outputLabel value="#{pageHelper.double2Percent(l.payCountRadio)}" />
								</p:column>
							</p:dataTable>
				        </p:tab>
				        
				        <p:tab title="区服对比" id="server1">
				        	<p:dataGrid id="chart133" var="c" value="#{bean.payCompareChart}" columns="1" layout="grid">
						        <p:panel style="text-align:center">
						            <h:panelGrid columns="1" style="width:100%">
						                <div id="highchartChart5" style="width:100%;height:400px; border:0;">
											<script type="text/javascript">
												generateChart('#{c.jsonStr}', '#{c.jsonType}', '5', 'basewidth2');
											</script>  
										</div>
						            </h:panelGrid>
						        </p:panel>
						    </p:dataGrid>
						    
						    <br />
						    <p:dataTable id="dlist133" var="l" value="#{bean.payCompareData}" scrollable="true" resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {Exporters}" rowsPerPageTemplate="15,30" rows="30" style="text-align:center;">
								<f:facet name="{Exporters}">
						        	<h:commandLink styleClass="exporter">
								        <p:graphicImage url="/resources/images/excel.png" height="25px"/>
								        <p:dataExporter type="xls" target="dlist133" fileName="serverPayCompareData-#{pageHelper.getNewDateDetailStr()}"/>
								    </h:commandLink>
							    </f:facet>
								
								<p:column headerText="分类" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.classStr}" />
								</p:column>
								<p:column headerText="付费人数" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.payUser}" />
								</p:column>
								<p:column headerText="付费人数比例" styleClass="column grcnewUser">
									<h:outputLabel value="#{pageHelper.double2Percent(l.payUserRadio)}" />
								</p:column>
								<p:column headerText="付费金额#{pageHelper.getMoneyType()}" styleClass="column grcnewUser">
									<h:outputLabel value="#{l.payCount}" />
								</p:column>
								<p:column headerText="付费金额比例" styleClass="column grcnewUser">
									<h:outputLabel value="#{pageHelper.double2Percent(l.payCountRadio)}" />
								</p:column>
							</p:dataTable>
				        </p:tab>
				    </p:tabView>
		        </p:tab>
		    </p:accordionPanel>
		</div>
	</h:form>

	<!-- 页脚 -->
	<div class="footer"></div>
</h:body>
</html>